import 'package:bottom_sheet_flutter/utils/style_util/style_util.dart';
import 'package:bottom_sheet_flutter/widgets/bottom_sheet_widget/action_bottom_sheet_widget_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/src/size_extension.dart';

import '../../widgets/text_widget/text_widget.dart';

/// @className : action_bottom_sheet
/// @date 2022/08/12 17:35
/// @author : xiaohai
/// @description : 动作抽屉页

class ActionBottomSheet extends StatefulWidget {
  const ActionBottomSheet({Key? key}) : super(key: key);

  @override
  _ActionBottomSheetState createState() => _ActionBottomSheetState();
}

class _ActionBottomSheetState extends State<ActionBottomSheet> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("动作抽屉层"),
        actions: [
          Container(
              //decoration: BoxDecoration(color: Colors.red),
              padding: EdgeInsets.only(left: 24.w, right: 24.w),
              alignment: Alignment.center,
              child: InkWell(
                  onTap: () {
                    ActionBottomSheetWidgetUtil().showActionBottomSheetWidget(
                        context, ["中国", "美国", "新加坡","英国"],
                        actionItemEvent: (String? title, int index) {
                      print("title===$title index===$index");
                      if (index == 0) {}
                    });
                  },
                  child: textWidget("显示",TS_FFFFFF_34_W5)))
        ],
      ),
      body: Container(),
    );
  }
}
